<div id = "problems">
<% if @problems%>
<% if @contest%>
  Viewing problems in contest 
  <%= link_to @contest.name,:action => :show_problems%>
  <%= link_to "(board)",:action => :view_board,:contest => @contest%>:
<% else%>
  Viewing all problems:
<% end%>
<table>
<tr>
<td><%= link_to "Problem_id:",:action => :show_problems,:contest =>@contest,:order => 'id'%></td>
<td><%= link_to "Name:",:action => :show_problems,:contest =>@contest,:order => 'name'%></td>
<% unless @contest%>
<td><%= link_to "Contest:",:action => :show_problems,:contest =>@contest,:order => 'contest'%></td>

<% end%>
<td>Time limit</td>
<td></td>
<td></td>
</tr>
<% @problems.each do |p|%>
  <tr>
  <td><%= p.problem_id%></td>
  <td><%= link_to p.name,:controller => :problems,:action =>:show, :id => p %></td>
<% unless @contest%>
<td><%= link_to p.contest.name,:action => :show_problems, :contest => p.contest%></td>
<% end%>
  <td><%= p.time_limit%></td>
  <td><%= link_to "Description",:action => :download_description,:problem => p%></td>
  <td><%= link_to "Submit",:action => :make_submit,:problem => p%></td>
  </tr>
<% end %>
</table>
<% else %>
  No problems found.
<% end %>
</div>
<% content_for :menu do%>
<%= link_to "Back",:back%>
<%= link_to "Back to index",:action => :index%>
<%= link_to "Status",:action => :status%>
<%= link_to "Logout",:controller => :session,:action => :logout%>
<% end%>
